/*
 * Copyright (c) 2025 Li Auto Inc. and its affiliates
 * Licensed under the Apache License, Version 2.0(the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ETH_GENERALTYPES_H
#define ETH_GENERALTYPES_H

#include "comstack_types.h"

typedef uint16 eth_frame_type;
typedef uint8 eth_data_type;

typedef enum {
	ETH_MODE_DOWN = 0x0U,
	ETH_MODE_ACTIVE = 0x1U
} eth_mode_type;

typedef enum {
	ETH_STATE_UNINIT = 0x0U,
	ETH_STATE_INIT = 0x1U
} eth_state_type;

typedef enum {
	ETH_RECEIVED = 0x0U,
	ETH_NOT_RECEIVED,
	ETH_RECEIVED_MORE_DATA_AVAILABLE
} eth_rx_status_type;

typedef enum {
	ETH_ADD_TO_FILTER = 0x0U,
	ETH_REMOVE_FROM_FILTER
} eth_filter_action_type;

typedef enum {
	ETH_OK = 0x0U,
	ETH_E_NOT_OK,
	ETH_E_NO_ACCESS
} eth_return_type;

typedef enum {
	ETH_VALID = 0x0U,
	ETH_INVALID,
	ETH_UNCERTAIN
} eth_timestamp_qual_type;

typedef struct {
	uint32 nanoseconds;
	uint32 seconds;
	uint16 secondsHi;
} eth_timestamp_type;

typedef struct {
	eth_timestamp_type diff;
	boolean sign;
} eth_time_int_diff_type;

typedef struct {
	eth_time_int_diff_type IngressTimeStampDelta;
	eth_time_int_diff_type OriginTimeStampDelta;
} eth_rateratio_type;

typedef uint32 eth_buf_idx_type;

#endif /* ETH_GENERALTYPES_H */
